﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iOak.Domain.Users;
using System.Web;
using System.Web.SessionState;

namespace iOak.Common
{
    public static class LoginInfo
    {
        private const String UserInfoSessionName = "LoginInfo_UserInfo";
        /// <summary>
        /// 登入人员信息
        /// </summary>
        public static User UserInfo
        {
            set {  
                HttpContext.Current.Session[UserInfoSessionName] = value;
            }
            get {
                User userInfo = null;
                if (HttpContext.Current.Session[UserInfoSessionName] != null) 
                {
                    userInfo = HttpContext.Current.Session[UserInfoSessionName] as User;
                }
                return userInfo;
            }
        }
    }
}
